package com.hc.model.code03.test7;

/**
 * @version v1.0
 * @ClassName: MenuComponent
 * @Description: 菜单组件 ： 属于抽象根节点
 * @Author: HC
 */
public abstract class MenuComponent {

    // 菜单组件名称
    public String name;
    // 菜单组件的层级
    public int level;

    // 添加子菜单
    public void add(MenuComponent menuComponent) {
        throw new UnsupportedOperationException();
    }

    // 删除子菜单
    public void remove(MenuComponent menuComponent) {
        throw new UnsupportedOperationException();
    }

    // 获取指定的子菜单
    public MenuComponent getChild(int index) {
        throw new UnsupportedOperationException();
    }

    // 获取菜单或菜单项的名称
    public String getName() {
        return name;
    }

    // 打印信息
    public abstract void print();
}
